package c_gs

import (
	"cade/src/game/app"
	"cade/src/game/app/modules/chat"
	"cade/src/game/msg"
)

func C_ChatSendText(message msg.Message, ctx interface{}) {
	req := message.(*msg.C_ChatSendText)
	plr := ctx.(*app.Player)

	res := &msg.GS_ChatSendText_R{}

	chat.SendText(plr, req.Text, func(ec int32) {
		res.ErrorCode = ec
		plr.SendMsg(res)
	})
}
